﻿
; 检测Actions\目录下的脚本，并自动Include到  lib\QZActions.ahk 中
QZActionCheck()
{
    FileEncoding,utf-8
    ExtensionsAHK := A_ScriptDir "\Lib\QZActions.ahk"
    ; 清理无用#include
    Filedelete,%ExtensionsAHK%
    FileAppend,%NewExtensions%,%ExtensionsAHK%
    ; 查询是否有新插件加入
    Loop,%A_ScriptDir%\Actions\*.ahk
        plugins .=  "#include *i `%A_ScriptDir`%\Actions\" A_LoopFileName "`n"
    FileAppend,%plugins%,%ExtensionsAHK%
    ; 保存修改时间
    SaveTime := "/*`r`n[ExtensionsTime]`r`n"
    Loop,%A_ScriptDir%\Actions\*.ahk
    {
        plugin :=  A_ScriptDir "\Actions\" A_LoopFileName 
        FileGetTime,ExtensionsTime,%plugin%,M
        SaveTime .= A_LoopFileName "=" ExtensionsTime "`r`n"
    }
    SaveTime .= "*/`r`n"
    FileAppend,%SaveTime%,%ExtensionsAHK%
    FileRead,Extensions,%ExtensionsAHK%
}

